package com.srcptit.trainning.tranquangvinh.b1;

import java.util.Scanner;

public class Bai4LietKeNgto {
	public static boolean Ngto(int n) {
		if(n<2) return false;
		if(n==2) return true;
		for(int i=2;i<=Math.sqrt(n);i++){
			if(n%i==0) return false;
		}
		return true;
	}
	public static void LietKeNgto(int n) {
		int dem=0,i=2;
		while(dem<n){
			if(Ngto(i)){
				dem++;
				System.out.print(i+" ");
			}
			i++;
		}
	}
	public static  void main(String[] args) {
		System.out.println("Nhap so nguyen n:");
		Scanner sc= new Scanner(System.in) ;
		int n;
		n=sc.nextInt();
		LietKeNgto(n);
	}
}
